package demo;


public class Factorial2 {
  
    public int factorial(int i){
        if (i==1){
            return 1;
        }else return i*factorial(i-1);
    }

    public static void main(String[] args) {
        Factorial2 f = new Factorial2();
        System.out.println(f.factorial(10));
    }
}

